//
//  JHZhuantiTableViewCell.m
//  Liberty Voice
//
//  Created by dlios on 15-5-17.
//  Copyright (c) 2015年 ClearLove. All rights reserved.
//

#import "JHZhuantiTableViewCell.h"
#import "UIImageView+WebCache.h"

@interface JHZhuantiTableViewCell ()

@property(nonatomic,retain)UIImageView *coverPathSmallI;
@property(nonatomic,retain)UILabel *titleL;
@property(nonatomic,retain)UIImageView *v;
@end

@implementation JHZhuantiTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.contentView.backgroundColor = [UIColor lightGrayColor];
        self.coverPathSmallI = [[[UIImageView alloc] init]autorelease];
        [self.contentView addSubview:_coverPathSmallI];
        
        self.v = [[[UIImageView alloc] init] autorelease];
        _v.image = [UIImage imageNamed:@"iconfont-bofangqixiayiqu"];
        [self.contentView addSubview:_v];
        
        self.titleL = [[[UILabel alloc] init] autorelease];
        _titleL.textAlignment = 1;
//        _titleL.textColor = [UIColor blackColor];
        [self.contentView addSubview:_titleL];
    }return self;
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    _coverPathSmallI.frame = CGRectMake(0, 0,self.contentView.frame.size.height - 4, self.contentView.frame.size.height - 4);
    _titleL.frame = CGRectMake(_coverPathSmallI.frame.size.width ,( self.contentView.frame.size.height / 2) -10, self.contentView.frame.size.width  - _coverPathSmallI.frame.size.width - 30, self.contentView.frame.size.height / 4);
    _v.frame = CGRectMake(_titleL.frame.origin.x + _titleL.frame.size.width ,0 , self.contentView.frame.size.width - _titleL.frame.size.width - _coverPathSmallI.frame.size.width - 10, self.contentView.frame.size.height );
}
- (void)setZhuanti:(JHZhuanti *)zhuanti
{
    if (zhuanti != _zhuanti) {
        [_zhuanti release];
        _zhuanti = [zhuanti retain];
    }
    [_coverPathSmallI sd_setImageWithURL:[NSURL URLWithString:zhuanti.coverPathSmall]];
//    NSLog(@"111111111111%@",zhuanti.coverPathSmall);
    _titleL.text = zhuanti.title;
    
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
